﻿namespace DCHealthCheck.MvcWeb.Controllers {

    #region Usings
    using DCHealthCheck.DomainModel;
    using DCHealthCheck.MvcWeb.Classes;
    using DCHealthCheck.MvcWeb.Classes.DataServices;
    using DCHealthCheck.MvcWeb.Classes.ViewModels;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    #endregion

    public class ReplicationController : BaseController {

        private readonly IPendingReplicationsDataService PendingReplicationsDataService;
        private readonly IReplicationNeighborDataService ReplicationNeighborDataService;

        public ReplicationController(IPendingReplicationsDataService pendingReplicationsDataService, IReplicationNeighborDataService replicationNeighborDataService) {
            if (pendingReplicationsDataService == null) {
                throw new ArgumentNullException("pendingReplicationsDataService");
            }
            if (replicationNeighborDataService == null) {
                throw new ArgumentNullException("replicationNeighborDataService");
            }
            this.ControllerName = "ReplicationNeighbor";
            this.PendingReplicationsDataService = pendingReplicationsDataService;
            this.ReplicationNeighborDataService = replicationNeighborDataService;
        }

        public ActionResult Index(ReplicationNeighborViewModel viewModel) {
            this.ReplicationNeighborDataService.ProcessData(viewModel);
            return View(viewModel);
        }

        public ActionResult PendingReplications(PendingReplicationsViewModel viewModel) {
            this.PendingReplicationsDataService.ProcessData(viewModel);
            return View(viewModel);
        }
    }
}
